<?php
$this->pageTitle=Yii::app()->name . ' - Заемщики';
$this->breadcrumbs=array(
	'Заемщики',
);
?>

<fieldset>
	<legend>Заемщики</legend>
	<div class="row">
		<div class="span12">
			<?php if(Yii::app()->user->getState('role')==Users::ADMIN_ROLE){
			$this->renderPartial('//menus/_admin_menu',array('active'=>'clients'));
		} else {
			$this->renderPartial('//menus/_manager_menu',array('active'=>'clients'));
		}?>

			<?php $this->widget('bootstrap.widgets.TbGridView', array(
				'type'=>'striped condensed',
				'dataProvider'=>$model->search(),
				'filter'=>$model,
				'enablePagination'=>true,
				'template'=>"{items}{pager}",
				'emptyText'=>'Клиент с такими данными не найден.',
				'showTableOnEmpty'=>true,
				'columns'=>array(
					array(
						'name'=>'id',
						'filter'=>false
					),
					array(
						'name'=>'fio',
						'header'=>'Ф.И.О.',
						'value'=>'CHtml::link($data->fio,Yii::app()->createUrl("clients/view",array("id"=>$data->id)))',
						'type'=>'raw'
					),
					array(
						'name'=>'dob',
						'value'=>'date("d.m.Y", strtotime($data->dob))',
					)
				),
			));?>
		</div>
	</div>
</fieldset>